﻿/*
 * Created by SharpDevelop.
 * User: xieen
 * Date: 2013-08-26
 * Time: 10:32
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace GoF23Learning._18.Memento_Pattern
{
	/// <summary>
	/// Description of Graphic.
	/// </summary>
	public class GraphicSystem
	{			
		//原发器对象
		Rectangle r = new Rectangle(0,0,10,20);
		//备忘录对象
		//保存原发器对象的内部状态
		Rectangle rsaved;

		public void Process()
		{
			 rsaved=(Rectangle) r.Clone();
			 
			 //改变r的属性 , r变成正方形
			 r.X = 20;
 		
		}
		public void Save_Click(object sender,EventArgs args)
		{
			r.SetValue(rsaved);
		}
	}
}
